<script type="text/javascript">
{literal}



////////////////date start
	$(function() {
		var dates = $('#from, #to').datepicker({
			//defaultDate: "+1w",
			changeMonth: true,
                        changeYear: true,
                        dateFormat: 'yy-mm-dd',
                        firstDay: 1 ,
			numberOfMonths: 3,
			onSelect: function(selectedDate) {
				var option = this.id == "from" ? "minDate" : "maxDate";
				var instance = $(this).data("datepicker");
				var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
				dates.not(this).datepicker("option", option, date);
			}
		});
        $('#kas').submit(function() {
             $(this).ajaxSubmit({target:'#content'});
              return false;
          });
	});

//////////////date end
</script>
{/literal}

<h1>Історія платежів</h1>

<form method="POST" action="index.php?type=kassa" id="kas">
Від: <input type="text" id="from" name="from" value="{if $smarty.post.from}{$smarty.post.from}{else}{$first}{/if}"/> До:
<input type="text" id="to" name="to"  value="{if $smarty.post.to}{$smarty.post.to}{else}{$last}{/if}"/>
Логін: <input type="text" name="user"  value="{if $smarty.post.user}{$smarty.post.user}{/if}{if $smarty.get.user}{$smarty.get.user}{/if}"/>
<input type="submit" />
</form>
<div id="#content"></div>


<table style="width:auto">
<thead>
<tr>
<th>№</th><th>Номер документу</th><th>Дата</th><th>Юзер</th><th>Сумма</th><th>Тип</th><th>Призначення</th>
</tr>
</thead>
<tbody>
{section name=i  loop=$kassa}
<tr>
<td>{$smarty.section.i.iteration}</td><td>{if $kassa[i].Number == 0}{$kassa[i].UID}{else}{$kassa[i].Number}{/if}</td><td>{$kassa[i].Date}</td><td>{$kassa[i].User}</td><td>{$kassa[i].Cash}</td><td>{if $kassa[i].Paytype == "nal"}Налік{/if}{if $kassa[i].Paytype == "bank"}Безнал{/if}{if $kassa[i].Paytype == "ukr"}UkrPays{/if}</td><td>{$kassa[i].Note}</td>
{/section}
</tr>
<tr>
<td></td><td></td><td></td><td><b>Сума:</b></td><td><b>{$kassa.0.c}грн.</b></td>
</tr>
</tbody>
</table>